package com.uzai.console.dto.wechatwork.devicewxworkinfo;

import com.uzai.console.common.utils.DateUtil;
import com.uzai.console.dto.QueryParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * @author liuqi
 * @date 2021年08月28日 19:52
 */
@ApiModel("企业微信机器人信息分页查询参数")
@Data
public class DeviceWxworkInfoQuery extends QueryParam {

    @ApiModelProperty("机器人主键id")
    private Long id;

    @ApiModelProperty("机器人ID列表")
    private List<Long> idList;

    @ApiModelProperty("机器人微信id")
    private String deviceId;

    @ApiModelProperty("机器人微信ID列表")
    private List<String> deviceIdList;

    @ApiModelProperty("机器人微信昵称")
    private String deviceName;

    @ApiModelProperty("机器人微信备注")
    private String deviceRemark;

    @ApiModelProperty("分组id")
    private Long groupId;

    @ApiModelProperty("分组id列表")
    private List<Long> groupIdList;

    @ApiModelProperty("功能类型")
    private String productCode;

    @ApiModelProperty(value = "配置方案id", hidden = true)
    private Long configId;

    @ApiModelProperty("到期类型(0-查询已经到期；1-查询未到期；2-查询即将到期（7天内)；3-查询即将到期（15天内)；4-查询即将到期（30天内)")
    private Integer expireType;

    @ApiModelProperty("查询开始到期时间")
    private Integer expireTimeStart;

    @ApiModelProperty("查询开始到期时间")
    private Integer expireTimeEnd;

    @ApiModelProperty("PC端状态（0-电脑离线；1-电脑在线）")
    private Integer pcStatus;

    @ApiModelProperty("移动端状态（0-手机离线；1-手机在线）")
    private Integer mobileStatus;

    @ApiModelProperty("工作状态(2=PC；9=手机)")
    private Integer recvmsgType;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public List<Long> getIdList() {
        return idList;
    }

    public void setIdList(List<Long> idList) {
        this.idList = idList;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDeviceRemark() {
        return deviceRemark;
    }

    public void setDeviceRemark(String deviceRemark) {
        this.deviceRemark = deviceRemark;
    }

    public Long getGroupId() {
        return groupId;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public Long getConfigId() {
        return configId;
    }

    public void setConfigId(Long configId) {
        this.configId = configId;
    }

    public Integer getExpireType() {
        return expireType;
    }

    public void setExpireType(Integer expireType) {
        this.expireType = expireType;
    }

    public Integer getExpireTimeStart() {
        if(expireType != null) {
            if (expireTimeStart == null) {
                expireTimeStart = DateUtil.getNowTime();
            }
        }
        return expireTimeStart;
    }

    public void setExpireTimeStart(Integer expireTimeStart) {
        this.expireTimeStart = expireTimeStart;
    }

    public Integer getExpireTimeEnd() {
        if(expireType != null){
            if(expireType.intValue() == 0){
                expireTimeEnd = getExpireTimeStart();
            }else if(expireType.intValue() == 1){
                expireTimeEnd = getExpireTimeStart();
            }else if (expireType.intValue() == 2){
                expireTimeEnd = getExpireTimeStart() + 604800;
            }else if (expireType.intValue() == 3){
                expireTimeEnd = getExpireTimeStart() + 1296000;
            }else if (expireType.intValue() == 4){
                expireTimeEnd = getExpireTimeStart() + 2592000;
            }
        }
        return expireTimeEnd;
    }

    public void setExpireTimeEnd(Integer expireTimeEnd) {
        this.expireTimeEnd = expireTimeEnd;
    }

    public List<Long> getGroupIdList() {
        return groupIdList;
    }

    public void setGroupIdList(List<Long> groupIdList) {
        this.groupIdList = groupIdList;
    }

    public List<String> getDeviceIdList() {
        return deviceIdList;
    }

    public void setDeviceIdList(List<String> deviceIdList) {
        this.deviceIdList = deviceIdList;
    }

    public Integer getPcStatus() {
        return pcStatus;
    }

    public void setPcStatus(Integer pcStatus) {
        this.pcStatus = pcStatus;
    }

    public Integer getMobileStatus() {
        return mobileStatus;
    }

    public void setMobileStatus(Integer mobileStatus) {
        this.mobileStatus = mobileStatus;
    }

    public Integer getRecvmsgType() {
        return recvmsgType;
    }

    public void setRecvmsgType(Integer recvmsgType) {
        this.recvmsgType = recvmsgType;
    }
}
